<?php

App::uses('AppController', 'Controller');

class PagesController extends AppController {

    public $uses = array( 'Page' );

    public function display($id) {
        
        $page = $this->Page->findById($id);
        if (empty($page)) {
			$this->redirect('/');
		}
		
        $this->pageTitle = $page['Page']['title'];
		$this->set(compact('page', 'title_for_layout'));
	}
}
